<div class="row">
     <div class="col-xs-12 col-xs-12">
          <div class="widget radius-bordered">
              <div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">用户编辑</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
              <div class="widget-body">
                   <form id="YstechForm" action="" method="post" class="form-horizontal"
                                                  data-bv-message=""
                                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                  <input type="hidden" name="userid" value="{$cache.userid}">
                  <div class="form-title">
                        <a href="{:U('Cms/Driver/driverList',array('p'=>$p))}" class="btn btn-primary" data-loader="Ystech-loader" data-loadername="用户列表">
							<i class="fa fa-mail-reply"></i>返回
						</a>
                   </div>
                   <!-- <div class="form-group">
                        <label class="col-lg-2 control-label">用户昵称<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" name="nickname" class="form-control" value="{$cache.nickname}">
                        </div>
                   </div> -->
				            <div class="form-group">
                        <label class="col-lg-2 control-label">姓名(真实)<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" name="username" class="form-control" value="{$cache.username}">
                        </div>
                    </div>
				            <div class="form-group">
                        <label class="col-lg-2 control-label">手机号<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" name="phone" class="form-control" value="{$cache.phone}">
                        </div>
                    </div>
				            <div class="form-group">
                        <label class="col-lg-2 control-label">身份证ID<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" name="idnum" class="form-control" value="{$cache.idnum}">
                        </div>
                    </div> 
				           <div class="form-group">
                        <label class="col-lg-2 control-label">用户状态</label>
                        <div class="col-lg-4">
                        <input type="text" name="status" class="form-control" placeholder="请填写0或1,0表示冻结,1表示正常" value="{$cache.status}">
                        </div>
                   </div>
                  <!-- <div class="form-group">
                        <label class="col-lg-2 control-label">用户元宝<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" name="coins" class="form-control" value="{$cache.coins}">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">用户房卡点数<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" name="gems" class="form-control" value="{$cache.gems}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">用户等级<sup>*</sup></label>
                        <div class="col-lg-2 control-label" style="text-align:left;">
                            {$cache.levelid} - {$levelinfo.name}
                        </div>
                    </div>-->
                    <!-- <div class="form-group">
                        <label class="col-lg-2 control-label">经验值</label>
                        <div class="col-lg-4">
                            
                        <input type="text" name="cur_exp" class="form-control" value="{$cache.cur_exp}">
                        </div>
                    </div> -->
                    <!--<div class="form-group">
                    <label class="col-lg-2 control-label">开启分销用户</label>
                        <div class="col-lg-4">
                        	<label>
                        		  <input type="hidden" name="isfx" value="{$cache.isfx}" id="isfx">
                                  <input class="checkbox-slider slider-icon colored-darkorange" type="checkbox" id="isfxbtn" <eq name="cache.isfx" value="1">checked="checked"</eq>>
                                  <span class="text darkorange">&nbsp;&nbsp;&larr;重要：启用后用户将变成分销用户,可享受提成。</span>
                            </label>
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">开启经销商</label>
                        <div class="col-lg-4">
                        	<label>
                        		  <input type="hidden" name="isjx" value="{$cache.isjx}" id="isjx">
                                  <input class="checkbox-slider slider-icon colored-darkorange" type="checkbox" id="isjxbtn" <eq name="cache.isjx" value="1">checked="checked"</eq>>
                                  <span class="text darkorange">&nbsp;&nbsp;&larr;重要：启用后用户可创建多个房间，做管理员。</span>
                            </label>
                        </div>
                   </div>-->
         <!--           
				   <div class="form-group">
                        <label class="col-lg-2 control-label">电子邮件</label>
                        <div class="col-lg-4">
                        <input type="text" name="email" class="form-control" value="{$cache.email}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">邮寄地址</label>
                        <div class="col-lg-4">
                        <input type="text" name="txszd" class="form-control" value="{$cache.txszd}">
                        </div>
                   </div> -->
				   <!--<div class="form-group">
                        <label class="col-lg-2 control-label">累计消费</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.total_buy}">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">下线人数</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control"   value="{$cache.total_xxlink}" disabled="disabled">
                        </div>
                   </div>
				   <div class="form-group">
                        <label class="col-lg-2 control-label">下线关注</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" value="{$cache.total_xxsub}" disabled="disabled">
                        </div>
                   </div>
				   <!--<div class="form-group">
                        <label class="col-lg-2 control-label">下线累计消费人次</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control"  value="{$cache.total_xxbuy}" disabled="disabled">
                        </div>
                   </div>
				   <div class="form-group">
                        <label class="col-lg-2 control-label">佣金总收益</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control"  name="total_xxyj" value="{$cache.total_xxyj}">
                        </div>
                   </div>
                   <div class="form-title"></div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">支付宝帐号</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.aliaccount}">
                        </div>
                   </div>
                   <!--提现信息-->
                  <!--<div class="form-title"></div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">提现姓名</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.txname}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现电话</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.txmobile}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现银行</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.txyh}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现分行</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.txfh}">
                        </div>
                   </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">提现卡号</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" disabled="disabled" value="{$cache.txcard}">
                        </div>
                   </div>-->
                  
                   
					<div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                             <button class="btn btn-primary btn-lg" type="submit">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
                             <button class="btn btn-palegreen btn-lg" type="reset">重填</button>
                        </div>
                    </div>
                   </form>
                </div>
        </div>
	</div>
     
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->

<!--表单验证与提交封装-->
<script type="text/javascript">
	$('#YstechForm').bootstrapValidator({
		submitHandler: function (validator, form, submitButton) {
			var lid='';
			var checks=$('.label-check');
			$(checks).each(function(){
				if($(this).is(":checked")){
					lid+=$(this).val()+',';
				}
			});
			$('#lid').val(lid);
			
			/*if(!$('input[name="nickname"]').val()){
				$.Ystech.alert('danger','请填写昵称！');
				return false;
			}*/
			
			if(!$('input[name="username"]').val()){
				$.Ystech.alert('danger','请填写真实姓名！');
				return false;
			}
			
			if(!$('input[name="phone"]').val()){
				$.Ystech.alert('danger','请填写手机号！');
				return false;
			}

      if(!$('input[name="idnum"]').val()){
        $.Ystech.alert('danger','请填写身份证号！');
        return false;
      }
			
       if(!($('input[name="status"]').val() == 0 || $('input[name="status"]').val() == 1)){
        $.Ystech.alert('danger','请填写有效数字！');
        return false;
      }
      
      var tourl="{:U('Cms/Driver/driverSet')}";
			var data=$('#YstechForm').serialize();
        console.log(tourl);
        console.log(data);
     /* $.ajax({
           url: tourl,
           type: "post",
           data: data,
           success: function(){
               console.log('OK');
           },
           error: function(){
              console.log('error');
           }
       });*/
			$.Ystech.ajax('post',tourl,data,null);
			return false;
        },
	});
	$('#isfxbtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#isfx').val(value);
	});
	
	$('#isjxbtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#isjx').val(value);
	});
	
</script>
<!--/表单验证与提交封装-->
